package com.todo.event.activity.application.handler.activitytouch;

import com.todo.event.activity.common.enums.EventActivityExecuteTouchEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/1/13 20:46
 * @description
 */
@Slf4j
@Component
public class TouchFactory {

    @Autowired
    List<AbstractTouchHandle> touchHandleList;

    public AbstractTouchHandle getTouchHandle(EventActivityExecuteTouchEnum touchEnum) {
        for (AbstractTouchHandle touchHandle : touchHandleList){
            if (touchHandle.getTouch().equals(touchEnum)) {
                return touchHandle;
            }
        }
        return null;
    }
}
